//
//  SimpleViewController.m
//  UITest
//
//  Created by wp w on 12-6-6.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "SimpleViewController.h"
#import "DLog.h"

@interface SimpleViewController ()

@end

@implementation SimpleViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
        
    LogRect(@"self.view.frame", self.view.frame);
    LogRect(@"self.view.bounds", self.view.bounds);
    
    //创建一个子view
    CGRect rect = CGRectMake(10, 10, 100, 100);
    UIView *myview = [[UIView alloc] initWithFrame:rect];
    myview.backgroundColor = [UIColor blueColor];
    [self.view addSubview:myview];
    LogRect(@"myview.frame", myview.frame);
    LogRect(@"myview.bounds", myview.bounds);
    [myview release];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
